It is common for computer systems to store data using virtual memory. Memory addresses in virtual memory are mapped to physical addresses in the computer system's memory, which may be physical memory (e.g. RAM), a hard disk, or any other suitable storage. Using virtual memory allows the operating system code to access stored data using a simple addressing structure. For example, data stored in memory can be moved between fast and slow memory storage (e.g. between RAM and hard disk), the virtual memory can appear to provide more memory than is actually available to the computer system, and any fragmentation of data in physical memory can be hidden from the operating system code.
Data is conventionally stored in virtual memory using pages, which are blocks of contiguous virtual memory addresses, usually of at least 4 kilobytes in size. Pages may be “pinned”, which means that the data the pages contain are not moved out to the hard disk (or other secondary storage). Pages may be permanently pinned, pinned for a long period or for only a short period, depending on the requirement of the computer system and/or code. When a page is unpinned prematurely, an operating system failure may be triggered when a subsequent attempt is made to access the page.
In normal operation of a computer system, if external interrupts are disabled and the operating system cannot ask the controller to swap a required page into physical memory, or if the computer system cannot satisfy a request to swap a page into physical memory, the page remains unavailable and the operating system will perform a crash behaviour (for example calling a crash/dump handler). It may be desirable to test operating system code to identify such crashes. However, under test conditions it is often the case that not all unpinned pages are swapped out to disk, even though it is possible that under different operating conditions all unpinned pages could be swapped out to disk. Thus, a crash behaviour that could occur under normal operation due to a page fault may not be detected during testing.